from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
from django.contrib import admin

import os.path

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    url(r'^$', direct_to_template, {"template": "homepage.html"}, name="home"),

    url(r'^accounts/login/$', 'django.contrib.auth.views.login', name="login"),
    url(r'^bookmarks/', include('bookmarks.urls')),
    url(r'^mindMap/', include('mindMap.urls')),
    url(r'^notices/', include('notification.urls')),
    url(r'^project/', include('projects.urls')),
    url(r'^crm/', include('crm.urls')),
    url(r'^event/', include('event.urls')),

    (r'^admin/(.*)', admin.site.root),
)

if settings.SERVE_MEDIA:
    urlpatterns += patterns('',
                            (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
                             {'document_root': os.path.join(os.path.dirname(__file__), "site_media")}),
                            )
